﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using A2DFramework.AOPService.Core;
using System.Xml.Linq;
using System.Reflection;

namespace A2DFramework.AOPService.Configuration
{
    public static class AOPServiceConfiguration
    {
        public static List<string> Processors=new List<string>();

        static AOPServiceConfiguration()
        {
            XElement root = XElement.Load(System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "A2D.config"));

            root = root.Element("AOP");
            if (root == null)
                throw new Exception("AOP node not exists");

            root = root.Element("AOPProcessors");
            if (root == null)
                throw new Exception("AOPProcessors node not exists");

            foreach (var ele in root.Elements("Processor"))
                Processors.Add(ele.Value);
        }

        public static void Load()
        { 
        }
    }
}
